package com.hfi.restful.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author ChangLiang
 * @date 2019/7/29
 */
@Target({ElementType.METHOD,ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = MyConstraintValidator.class)
public @interface MyConstraint {
    // 自定义validate注解必须要写的三个方法
    String message() default "{用户名不符合指定要求}";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
}
